global pointCursor, handCursor, grabCursor, yearList, lastYear, holList, lastHol, lastHoc, hocList
set pointCursor to [the number of member "pointer cursor", the number of member "pointer mask"]
set handCursor to [the number of member "hand cursor", the number of member "hand mask"]
set grabCursor to [the number of member "grab cursor", the number of member "grab mask"]
set yearList to ["intro","1066","1097","1215","1254","1265","1295","1341","1376","1523","1547","1605","1640","1678","1678a","1688","1694","1707","1716","1801","1803","1812","1832","1834","1852","1867","1911","1911a","1918","1918a","1941","1958","1978","1992"]
set lastYear = "intro"
set holList to ["intro","ORIGINS","THE LORDS' CHAMBER","MEMBERSHIP OF THE HOUSE","THE WORK OF THE LORDS","PROCEDURE","CEREMONIAL","REFORM OF THE LORDS"]
set lastHol to 0
set hocList to ["intro","history of the commons","the chamber","The Speaker","Membership of the House","The Work of the House","Government Bills","Committees","Procedure","Traditions and Customs"]
set lastHoc to 0
global gQTVRObj
-- register the Quicktime VR component
QTVREnter(xtra "QTVRXtra")
-- create a new instance of the xtra
set gQTVRObj = new(xtra "QTVRXtra")
end
on stopMovie
global gQTVRObj
-- Close any open QTVR movies
QTVRClose(gQTVRObj)
-- unregister the Quicktime VR component
QTVRExit(xtra "QTVRXtra")
end
on wait howlong
startTimer
repeat while the timer < howlong
nothing
end repeat
end
on click
if soundBusy (1) then
if the volume of sound 1 < 30 then
sound stop 1
puppetSound 2, "click"
updateStage
else
sound fadeOut 1, 60
puppetSound 2, "click"
updateStage
end if
ELSE if soundBusy (2) then
if the volume of sound 2 < 30 then
sound stop 2
puppetSound 1, "click"
updateStage
else
sound fadeOut 2, 60
puppetSound 1, "click"
updateStage
end if
end if
end
on press
set the member of sprite the clickOn to member (the memberNum of sprite the clickOn +1) of castLib (the castLibNum of sprite the clickOn)
click
wait 30
set the member of sprite the clickOn to member (the memberNum of sprite the clickOn -2) of castLib (the castLibNum of sprite the clickOn)
set the cursor of sprite the clickOn to -1
updateStage
end
on advance
press
wipeDown
go next
end
on stepBack
press
wipeDown
go previous
end
on showPicture
--press
puppetSprite the clickOn, FALSE
dissolve
go to the frame +1
end
on showText
--press
puppetSprite the clickOn, FALSE
dissolve
go to the frame -1
end
on wipeDown
puppetTransition 03, 4
end
on wipeRight
puppetTransition 01, 6
end
on dissolve
puppetTransition 51, 6
end
on circleDrag sNum,sC,whichHandler
puppetSprite sNum,true
set rC = the width of sprite sC/2
set rSNum to the width of sprite sNum/2
set cH to the locH of sprite sC + 1
set cV to the locV of sprite sC
set rC to rC - rSNum -2
set deltaH to the locH of the clickLoc - the locH of sprite sNum
set deltaV to the locV of the clickLoc - the locV of sprite sNum
repeat while the mouseDown -- and the mouseCast = the number of member (the member of sprite 20)
if the mouseH < cH then
set mH to the mouseH - deltaH
set mV to the mouseV - deltaV
set A to mH - cH
set B to mV - cV
set r to sqrt(A*A + B*B)
if A <> 0 then
set grad = float(B)/A
set constraint = 2.2 -- tan of 130 degrees swing
if grad <= constraint and grad >= 0 - constraint then
set angle = atan (grad) + atan (constraint)
do whichHandler && "angle / (atan(constraint)*2)" -- return percentage of travel
set newX = rC/sqrt(1+grad*grad)
if mH < cH then set newX to 0 - newX
set newY to Grad*newX
set the locH of sprite sNum to newX + cH
set the locV of sprite sNum to newY + cV
end if
end if
updateStage
end if
end repeat
end
on displayMP percentVal
global whichMP, lastMP
set menuNum to integer(15 * percentval)
set menuNum to 15 - menuNum -- inverts
if menuNum = 0 then set menuNum =1
puppetSprite 18, TRUE
set the member of sprite 18 to member ("gp" && menuNum && "shadow")
puppetSprite 19, TRUE
set the member of sprite 19 to member ("gp" && menuNum && "title")
if lastMP <> menuNum then
set the visible of sprite 6 to FALSE
-- hideBalls
set lastMP = menuNum
puppetSound "tic"
end if
updateStage
set whichMP to menuNum -- return which menu item selected
end
on displayDay percentVal
global whichDay, lastDay
set menuNum to integer(28 * percentval)
set menuNum to 28 - menuNum -- inverts
if menuNum = 0 then set menuNum =1
puppetSprite 18, TRUE
set the member of sprite 18 to member ("dt" && menuNum && "shadow")
puppetSprite 19, TRUE
set the member of sprite 19 to member ("dt" && menuNum && "title")
if lastDay <> menuNum then
set the visible of sprite 6 to FALSE
-- hideBalls
set lastDay = menuNum
puppetSound "tic"
end if
updateStage
set whichDay to menuNum -- return which menu item selected
end
on displayYear percentVal
global yearList, whichYear, lastYear
set menuNum to integer(count(yearList) * percentval)
set menuNum to count(yearList) - menuNum -- inverts
if menuNum = 0 then set menuNum =1
puppetSprite 18, TRUE
set the member of sprite 18 to member ("tl" && string(getAt(yearList, menuNum)) && "shadow")
puppetSprite 19, TRUE
set the member of sprite 19 to member ("tl" && string(getAt(yearList, menuNum)) && "title")
if lastYear <> menuNum then
set the visible of sprite 6 to FALSE
hideBalls
set lastYear = menuNum
puppetSound "tic"
end if
updateStage
set whichYear to getAt(yearList, menuNum) -- return which menu item selected
end
on displayLords percentVal
global holList, whichHol, lastHol
set menuNum to integer(count(holList) * percentval)
set menuNum to count(holList) - menuNum -- inverts
if menuNum = 0 then set menuNum =1
puppetSprite 18, TRUE
set the member of sprite 18 to member ("hol" && string(getAt(holList, menuNum)) && "TITLE SHADOW")
puppetSprite 19, TRUE
set the member of sprite 19 to member ("hol" && string(getAt(holList, menuNum)) && "TITLE")
if lastHol <> menuNum then
set the visible of sprite 6 to FALSE
hideBalls
set lastHol = menuNum
puppetSound "tic"
end if
updateStage
set whichHol to menuNum -1 -- return which menu item selected with offset to allow 0 value at intro
end
on displayCommons percentVal
global hocList, whichHoc, lastHoc
set menuNum to integer(count(hocList) * percentval)
set menuNum to count(hocList) - menuNum -- inverts
if menuNum = 0 then set menuNum =1
puppetSprite 18, TRUE
set the member of sprite 18 to member ("hoc" && string(getAt(hocList, menuNum)) && "shadow")
puppetSprite 19, TRUE
set the member of sprite 19 to member ("hoc" && string(getAt(hocList, menuNum)))
if lastHoc <> menuNum then
set the visible of sprite 6 to FALSE
hideBalls
set lastHoc = menuNum
puppetSound "tic"
end if
updateStage
set whichHoc to menuNum -1 -- return which menu item selected with offset to allow 0 value at intro
end
on hideBalls
repeat with n = 23 to 39
if the scoreColor of sprite n then
puppetSprite n, TRUE
set the member of sprite n to member "grey ball"
end if
end repeat
updateStage
end
on showBalls
repeat with n = 23 to 39
puppetSprite n, FALSE
end repeat
updateStage
end
on clearPuppets
repeat with n = 2 to 39
puppetSprite n, FALSE
set the cursor of sprite n to 0
end repeat
repeat with n = 2 to 39
SET THE VISIBLE OF SPRITE n TO TRUE
end repeat
end
on clearCursors
repeat with n = 3 to 24
set the cursor of sprite n to 0
end repeat
end
on ballRolloverCheck whichColour
global pointCursor
if rollover(10) and the mouseCast = the number of member (the member of sprite 10) then
repeat with n = 11 to 14
puppetSprite n, TRUE
end repeat
set the member of sprite 11 to member (whichColour && "start button")
set the member of sprite 12 to member (whichColour && "menu button")
set the member of sprite 13 to member (whichColour && "previous button")
set the member of sprite 14 to member (whichColour && "next button")
else if rollover(11) then
repeat with n = 11 to 14
puppetSprite n, TRUE
end repeat
set the member of sprite 11 to member (whichColour && "start button white")
set the cursor of sprite 11 to pointCursor
set the member of sprite 12 to member (whichColour && "menu button")
set the member of sprite 13 to member (whichColour && "previous button")
set the member of sprite 14 to member (whichColour && "next button")
else if rollover(12) then
repeat with n = 11 to 14
puppetSprite n, TRUE
end repeat
set the member of sprite 11 to member (whichColour && "start button")
set the member of sprite 12 to member (whichColour && "menu button white")
set the cursor of sprite 12 to pointCursor
set the member of sprite 13 to member (whichColour && "previous button")
set the member of sprite 14 to member (whichColour && "next button")
else if rollover(13) then
repeat with n = 11 to 14
puppetSprite n, TRUE
end repeat
set the member of sprite 11 to member (whichColour && "start button")
set the member of sprite 12 to member (whichColour && "menu button")
if the scriptNum of sprite 13 then -- check to see if any lingo attached to previous button
set the member of sprite 13 to member (whichColour && "previous button white")
set the cursor of sprite 13 to pointCursor
end if
set the member of sprite 14 to member (whichColour && "next button")
else if rollover(14) then
repeat with n = 11 to 14
puppetSprite n, TRUE
end repeat
set the member of sprite 11 to member (whichColour && "start button")
set the member of sprite 12 to member (whichColour && "menu button")
set the member of sprite 13 to member (whichColour && "previous button")
if the scriptNum of sprite 14 then -- check to see if any lingo attached to next button
set the member of sprite 14 to member (whichColour && "next button white")
set the cursor of sprite 14 to pointCursor
end if
else
repeat with n = 11 to 14
puppetSprite n, FALSE
set the cursor of sprite n to -1
end repeat
end if
if rollover(20) then -- picture/text icons
puppetSprite 20, TRUE
set the cursor of sprite 20 to pointCursor
if the scoreColor of sprite 20 = 2 then -- picture icon is green cell
set the member of sprite 20 to member "picture icon red"
else
set the member of sprite 20 to member "text icon red"